
#include "usart.h"

void usart_send_string(const unsigned char * string)
{
    unsigned int i = 0;

    while (string[i] != '\0')
        i++;

    while (HAL_UART_Transmit(&Uart2Handle, (unsigned char *)string, i, 0XFFFF) != HAL_OK);
}

void usart_send_fmt_string(unsigned char * format, ...)
{
    unsigned char value[128];

    va_list parameter_pointer;
    va_start(parameter_pointer, format);

    vsprintf(value, format, parameter_pointer);
    
    va_end(parameter_pointer);

    usart_send_string(value);
}
